import 'package:taonile/generated/json/base/json_convert_content.dart';
import 'package:taonile/entity/goods_area_category_entity.dart';

GoodsAreaCategoryEntity $GoodsAreaCategoryEntityFromJson(Map<String, dynamic> json) {
	final GoodsAreaCategoryEntity goodsAreaCategoryEntity = GoodsAreaCategoryEntity();
	final int? code = jsonConvert.convert<int>(json['code']);
	if (code != null) {
		goodsAreaCategoryEntity.code = code;
	}
	final String? msg = jsonConvert.convert<String>(json['msg']);
	if (msg != null) {
		goodsAreaCategoryEntity.msg = msg;
	}
	final List<GoodsAreaCategoryData>? data = jsonConvert.convertListNotNull<GoodsAreaCategoryData>(json['data']);
	if (data != null) {
		goodsAreaCategoryEntity.data = data;
	}
	return goodsAreaCategoryEntity;
}

Map<String, dynamic> $GoodsAreaCategoryEntityToJson(GoodsAreaCategoryEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['code'] = entity.code;
	data['msg'] = entity.msg;
	data['data'] =  entity.data.map((v) => v.toJson()).toList();
	return data;
}

GoodsAreaCategoryData $GoodsAreaCategoryDataFromJson(Map<String, dynamic> json) {
	final GoodsAreaCategoryData goodsAreaCategoryData = GoodsAreaCategoryData();
	final String? id = jsonConvert.convert<String>(json['id']);
	if (id != null) {
		goodsAreaCategoryData.id = id;
	}
	final String? imgPath = jsonConvert.convert<String>(json['img_path']);
	if (imgPath != null) {
		goodsAreaCategoryData.imgPath = imgPath;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		goodsAreaCategoryData.name = name;
	}
	final String? sort = jsonConvert.convert<String>(json['sort']);
	if (sort != null) {
		goodsAreaCategoryData.sort = sort;
	}
	return goodsAreaCategoryData;
}

Map<String, dynamic> $GoodsAreaCategoryDataToJson(GoodsAreaCategoryData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['img_path'] = entity.imgPath;
	data['name'] = entity.name;
	data['sort'] = entity.sort;
	return data;
}